Skip to content

fix(enforcer): two latent bugs in doc consistency and section ordering - #367

Merged
adamw7 merged 1 commit into
mainfrom
claude/enforcer-bugs-ojbxc9
Jul 10, 2026
Merged

fix(enforcer): two latent bugs in doc consistency and section ordering#367
adamw7 merged 1 commit into
mainfrom
claude/enforcer-bugs-ojbxc9

Conversation

@adamw7

@adamw7 adamw7 commented Jul 10, 2026

Copy link
Copy Markdown
Owner
  • DocumentConsistency.capture threw NullPointerException when a valid
    single-group pattern's group did not participate in the match (e.g. an
    optional group like proto(\d)?). Optional.of(null) blew up instead of
    treating the fact as absent; use Optional.ofNullable so the mismatch is
    reported cleanly.
  • MarkdownDocument.headingsInOrder collected every occurrence of a required
    heading while the compared "expected" list is de-duplicated, so a required
    section appearing twice produced a spurious "sections are out of order"
    failure. De-duplicate to first occurrence.

Add regression tests for both.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01LP9LjCJWatVErftj5NiqVP

- DocumentConsistency.capture threw NullPointerException when a valid
  single-group pattern's group did not participate in the match (e.g. an
  optional group like proto(\d)?). Optional.of(null) blew up instead of
  treating the fact as absent; use Optional.ofNullable so the mismatch is
  reported cleanly.
- MarkdownDocument.headingsInOrder collected every occurrence of a required
  heading while the compared "expected" list is de-duplicated, so a required
  section appearing twice produced a spurious "sections are out of order"
  failure. De-duplicate to first occurrence.

Add regression tests for both.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LP9LjCJWatVErftj5NiqVP
@adamw7
adamw7 merged commit ca44ddd into main Jul 10, 2026
3 checks passed
@adamw7
adamw7 deleted the claude/enforcer-bugs-ojbxc9 branch July 10, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants